import request from '@/utils/request'
import type { ResponseData } from '@/utils/request'

export interface InterViewParams {
  user_id: number
  page: number
  page_size: number
}

export interface InterviewInfo {
  id: number
  user_id: number
  company_id: number
  name: string
  job_title: string
  location: string
  interview_time: string
  interview_type: string
  interview_status: string
  interview_result: string
  interview_feedback: string
  
}

export interface Interview{
  id: number
  evaluation_file_path: string
  interview_process_file_path: string
  video_path: string
}

/**
 * User login
 * @param data Login parameters
 */
export function getInterviewList(data: InterViewParams) {
  return request<ResponseData<InterviewInfo>>({
    url: '/interview/query_company0/?user_id='+data.user_id+'&page='+data.page+'&page_size='+data.page_size,
    method: 'get'
  })
}

/**
 * User login
 * @param data Login parameters
 */
export function saveInterviewInfo(data: Interview) {
  return request({
    url: '/interview/update_interview_files/',
    method: 'post',
    data
  })
}
